package com.chao.yyks.modular.studentMsg.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.chao.common.util.DateUtile;
import com.chao.common.util.reaction.PageList;
import com.chao.yyks.modular.studentMsg.bean.EnStudentMsg;
import com.chao.yyks.modular.studentMsg.mapper.EnStudentMsgMapper;
import com.chao.yyks.modular.studentMsg.service.EnStudentMsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;


/**
 * 学生留言ServiceImpl
 * chao
 * 2024-10-17
 */
@Service
public class EnStudentMsgServiceImpl implements EnStudentMsgService {

	/**
	 * 学生留言Mapper
	 */
	@Autowired
	private EnStudentMsgMapper enStudentMsgMapper;

	/**
	 * 新增学生留言
	 */
	@Override
	@Transactional
	public void insertEnStudentMsg(EnStudentMsg enStudentMsg){
		enStudentMsg.setCtime(new Date());
		enStudentMsg.setProblemDate(DateUtile.laseWook());
		enStudentMsgMapper.insertEnStudentMsg(enStudentMsg);
	}

	/**
	 * 修改学生留言
	 */
	@Override
	@Transactional
	public void updateEnStudentMsg(EnStudentMsg enStudentMsg){
		enStudentMsgMapper.updateEnStudentMsg(enStudentMsg);
	}

	/**
	 * 物理删除学生留言
	 */
	@Override
	@Transactional
	public void deleteDataEnStudentMsg(String id){
		enStudentMsgMapper.deleteDataEnStudentMsg(id);
	}

	/**
	 * 查询学生留言详情
	 */
	@Override
	public EnStudentMsg selectEnStudentMsgById(String id){
		return enStudentMsgMapper.selectEnStudentMsgById(id);
	}

	/**
	 * 查询学生留言列表
	 */
	@Override
	public PageList<EnStudentMsg> selectEnStudentMsgByList(JSONObject json){
		return enStudentMsgMapper.selectEnStudentMsgByList(json);
	}

}